﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace manySquares
{
    class Unit
    {
        private int Health;
        private int Cost;
        private int Speed;
        private int Range;
        private int Damage;
        private int Armor;
        private int Movement;
        private String Type;
        public Unit(String type)
        {
            Type = type;
            if (Type.Equals("Melee"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 1;
                Movement = 2;
            }
            if (Type.Equals("Rangers"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 5;
                Movement = 1;
            }
            if (Type.Equals("Catapults"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 10;
                Movement = 1;
            }
            if (Type.Equals("Builder"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 1;
                Movement = 2;
            }
        }
        public int getSpeed()
        {
            return Speed;
        }
        public int getRange()
        {
            return Range;
        }
        public String getType()
        {
            return Type;
        }
        public void setType(String iunit)
        {
            Type = iunit;
            if (Type.Equals("Melee"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 1;
            }
            if (Type.Equals("Ranger"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 5;
            }
            if (Type.Equals("Catapult"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 10;
            }
            if (Type.Equals("Builder"))
            {
                Health = 1;
                Cost = 1;
                Speed = 1;
                Damage = 1;
                Armor = 1;
                Range = 1;
            }
            if (Type.Equals("None"))
            {
                Health = 0;
                Cost = 0;
                Speed = 0;
                Damage = 0;
                Armor = 0;
                Range = 0;
            }
        }
    }
}
